package Controller.SCServlet;

import Dao.CourseDao;
import Dao.SCDao;
import bean.SC;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

@WebServlet("/sc_change")
public class sc_change extends HttpServlet {
    SCDao scDao = new SCDao();
    CourseDao courseDao = new CourseDao();
    @Override
    protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        super.doPost(req, resp);
    }

    @Override
    protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        req.setCharacterEncoding("utf-8");
        String sno = req.getParameter("sno");
        String cno = req.getParameter("cno");
        SC sc = scDao.select(sno,cno).get(0);
        req.setAttribute("sc", sc);
        req.getRequestDispatcher("SCInfoChange.jsp").forward(req,resp);
    }
}
